package com.victor.dao;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.victor.entity.PicturePath;

@Mapper
public interface PicturePathDao {

	@Insert("insert into picturepath(p_id,p_image,p_audio,p_pid) values (#{pid},#{pImage},#{pAudio},#{pPid})")
	@Options(useGeneratedKeys = true,keyProperty = "pid")
	int save(PicturePath p);

	int setPidToPath(@Param("ids")int[] pathids,@Param("pid") Integer pid);

	@Select("select p_id pid, p_image pImage,p_audio pAudio,p_pid pPid from picturepath where p_pid = #{pid}")
	List<PicturePath> findByPid(@Param("pid")Integer pid);
	
	int batchDelete(@Param("ids")int[] ids);

	int update(PicturePath p);

}
